import http from "@/utils/request";
export function getCompany(pageParam:any){
    
//     // 对 search 参数进行编码
//   if (pageParam.search) {
//     pageParam.search = encodeURIComponent(pageParam.search);
//   }
    return http.request({
        url:"/glacier-hardware/company/selectByPage",
        method:'get',
        params:pageParam
    })
}
export function deleteCompany(id:any){
    return http.request({
        url:"/glacier-hardware/company/deleteById",
        method:'get',
       params:{id}
    })
}
// export function addCompany(companyAddDTO:any){
//     return http.request({
//         url:"/company/add",
//         method:'post'
//     //    params:companyAddDTO
//     })
// }

export function addCompany(companyAddDTO: any) {
    return http.request({
      url: "/glacier-hardware/company/add",
      method: 'post',
      data: companyAddDTO
    });
  }
export function findById(id:any){
    return http.request({
        url:"/glacier-hardware/company/findById",
        method:'get',
       params:{id}
    })
}
export function updateCompany(companyUpdateDTO:any){
    return http.request({
        url:"/glacier-hardware/company/update",
        method:'post',
        data:companyUpdateDTO
    })
}